/*
 * frxs Inc.  湖南兴盛优选电子商务有限公司.
 * Copyright (c) 2017-2019. All Rights Reserved.
 */

package com.zwl.controller;


import com.zwl.model.vo.RobotStoreGrayVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author zhangweilin
 * @date 2021/8/3 14:42
 * @Description: 灰度操作之推送
 */
@RestController
@RequestMapping("/vgroup/push")
public class VgroupPushController {

    /**
     * 查询灰度信息
     *
     * @param storeCode 111233
     * @return
     */
    @GetMapping("/push")
//    @ApiOperation(value = "加载灰度信息11111",notes = "加载灰度信息,详细描述222")
    public RobotStoreGrayVo push(String storeCode) {
        System.out.println("storeCode = " + storeCode);
        RobotStoreGrayVo robotStoreGrayVo = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo;
    }

    /**
     * 查询 灰度 信息 haha 第二个嘛
     *
     * @param storeCode 门店编码1234567
     * @param storeId   门店id1234567
     * @return
     */
    @GetMapping("/push2")
//    @ApiImplicitParams(value = {
//            @ApiImplicitParam(name = "storeCode", value = "门店编码22"),
//            @ApiImplicitParam(name = "storeId", value = "门店id222")}
//    )
    public RobotStoreGrayVo push(String storeCode, int storeId) {

        System.out.println("storeCode = " + storeCode);
        RobotStoreGrayVo robotStoreGrayVo = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo;
    }

    @GetMapping("/push3")
    public RobotStoreGrayVo getGrayInfo3(String storeCode, int storeId, String userName) {
        System.out.println("storeCode = " + storeCode);
        System.out.println("storeId = " + storeId);
        RobotStoreGrayVo robotStoreGrayVo = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo;
    }

    /**
     * 测试一下第四种情况
     * @param robotStoreGrayVo 灰度对象 *
     * @param storeCode *
     * @param storeId
     * @param userName  用户名 *
     * @return
     */
    @GetMapping("/push4")
//    public RobotStoreGrayVo getGrayInfo4(RobotStoreGrayVo robotStoreGrayVo, String storeCode, int storeId, String userName) {
    public RobotStoreGrayVo getGrayInfo4(RobotStoreGrayVo robotStoreGrayVo, String storeCode, int storeId, String userName) {
        System.out.println("robotStoreGrayVo = " + robotStoreGrayVo);
        System.out.println("storeCode = " + storeCode);
        System.out.println("userName = " + userName);
        System.out.println("storeId = " + storeId);
        RobotStoreGrayVo robotStoreGrayVo2 = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo2;
    }

    /**
     *  单独的对象
     * @param robotStoreGrayVo
     * @return
     */
    @GetMapping("/push5")
//    public RobotStoreGrayVo getGrayInfo4(RobotStoreGrayVo robotStoreGrayVo, String storeCode, int storeId, String userName) {
    public RobotStoreGrayVo getGrayInfo5(RobotStoreGrayVo robotStoreGrayVo) {
        System.out.println("robotStoreGrayVo = " + robotStoreGrayVo);
        RobotStoreGrayVo robotStoreGrayVo2 = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo2;
    }

    /**
     *   单独的对象2
     * @param robotStoreGrayVo
     * @return
     */
    @PostMapping("/push6")
//    public RobotStoreGrayVo getGrayInfo4(RobotStoreGrayVo robotStoreGrayVo, String storeCode, int storeId, String userName) {
    public RobotStoreGrayVo getGrayInfo6(@RequestBody RobotStoreGrayVo robotStoreGrayVo) {
        System.out.println("robotStoreGrayVo = " + robotStoreGrayVo);
        RobotStoreGrayVo robotStoreGrayVo2 = RobotStoreGrayVo.builder().grayFlag(true).storeName("zwl").storeCode("yyy").build();
        return robotStoreGrayVo2;
    }
}
